<template>
<router-view v-slot="{ Component }">

    <keep-alive v-if="$route.meta.keepAlive">
      <component :is="Component" />
    </keep-alive>
    <component v-else :is="Component" />

</router-view>
</template>

<script>
export default {
  mounted() {
    // 初始化用户信息
    this.$store.dispatch('initUser');
  }
};
</script>

<style>
#app {
  font-family: Avenir, Helvetica, Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  color: #2c3e50;
  background-color: #f7f7f7;
  height: 100%;
  position: relative;
}

</style>
